Skip to content

Add aggregator CLI commands for configuration parameters - #3438

Open
turmelclem wants to merge 19 commits into
mainfrom
ctl/3392-add-aggregator-CLI-command-for-configuration-parameters
Open

Add aggregator CLI commands for configuration parameters#3438
turmelclem wants to merge 19 commits into
mainfrom
ctl/3392-add-aggregator-CLI-command-for-configuration-parameters

Conversation

@turmelclem

@turmelclem turmelclem commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Content

aggregator cli :

  • export command
    • look for markers on chain and export then into JSON format (if it exists, otherwise it export a default configuration)
  • import command generating datum file from a JSON file
    • verifying user JSON file consistency (non zero values, configurations and enabled signed entity type consistency)
    • verifying configuration to import against configuration on chain TODO
    • checking datum that not exceed 10kb (since a full cardano transaction is 16kb) TODO
    • writing a JSON HEX datum file at given path

protocol-config :

  • a adapter trait that is used by aggregagtor cli to retrieve information about protocol configuration markers
    • with the intelligence to retrieve the configuration of the nearest known epoch
  • cbor encoding/decoding of marker configuration

Pre-submit checklist

  • Branch
    • Tests are provided (if possible)
    • Crates versions are updated (if relevant)
    • CHANGELOG file is updated (if relevant)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
  • PR
    • All check jobs of the CI have succeeded
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested
  • Documentation
    • Update README file (if relevant)
    • Update documentation website (if relevant)
    • Add dev blog post (if relevant)
    • Add ADR blog post or Dev ADR entry (if relevant)
    • No new TODOs introduced

Issue(s)

this PR closes #3392

@turmelclem turmelclem self-assigned this Jul 27, 2026
Comment thread internal/mithril-protocol-config/src/adapters/cardano_chain.rs Fixed
Comment thread internal/mithril-protocol-config/src/adapters/cardano_chain.rs Fixed
Comment thread internal/mithril-protocol-config/src/adapters/cardano_chain.rs Fixed
Comment thread internal/mithril-protocol-config/src/adapters/cardano_chain.rs Fixed

@github-advanced-security github-advanced-security AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clippy found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown

Test Results

     5 files  ±  0     209 suites  ±0   54m 7s ⏱️ - 12m 19s
 3 369 tests + 33   3 369 ✅ + 33  0 💤 ±0  0 ❌ ±0 
11 225 runs  +119  11 225 ✅ +119  0 💤 ±0  0 ❌ ±0 

Results for commit a134e72. ± Comparison against base commit cfb446a.

♻️ This comment has been updated with latest results.

Comment thread internal/mithril-protocol-config/src/cardano_chain/mod.rs Fixed
Comment thread internal/mithril-protocol-config/src/cardano_chain/mod.rs Fixed
Comment thread internal/mithril-protocol-config/src/cardano_chain/mod.rs Fixed
Comment thread internal/mithril-protocol-config/src/lib.rs Fixed
Comment thread internal/mithril-protocol-config/src/cardano_chain/mod.rs Fixed
Comment thread internal/mithril-protocol-config/src/cardano_chain/mod.rs Fixed
Comment thread internal/mithril-protocol-config/src/cardano_chain/mod.rs Fixed
Comment thread mithril-aggregator/src/commands/protocol_configuration_command.rs Fixed
Comment thread mithril-aggregator/src/commands/protocol_configuration_command.rs Fixed
Comment thread mithril-aggregator/src/commands/protocol_configuration_command.rs Fixed
Comment thread mithril-aggregator/src/dependency_injection/containers/serve.rs Fixed
Comment thread mithril-aggregator/src/dependency_injection/containers/serve.rs Fixed
@turmelclem
turmelclem force-pushed the ctl/3392-add-aggregator-CLI-command-for-configuration-parameters branch 3 times, most recently from ddfd41b to 10aa1ef Compare July 30, 2026 12:38
Comment thread mithril-aggregator/src/commands/protocol_configuration_command.rs Fixed
Comment thread mithril-aggregator/src/commands/protocol_configuration_command.rs Fixed
@turmelclem
turmelclem marked this pull request as ready for review July 31, 2026 12:05
@turmelclem
turmelclem force-pushed the ctl/3392-add-aggregator-CLI-command-for-configuration-parameters branch 6 times, most recently from 2d65553 to ccb24d2 Compare July 31, 2026 13:10
@jpraynaud
jpraynaud requested a review from Copilot July 31, 2026 13:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces new aggregator CLI commands to export/import protocol configuration markers, along with a new mithril-protocol-config reader interface/model and Cardano-chain message/payload encoding support to make protocol configuration markers portable and verifiable.

Changes:

  • Add protocol-configuration export-markers / import-markers CLI commands (JSON export + datum generation/import validation).
  • Add protocol-configuration “tools” and dependency injection wiring to read on-chain markers and generate signed datums.
  • Add mithril-protocol-config models/messages (CBOR encoding) + payload signing structure + test doubles.

Reviewed changes

Copilot reviewed 26 out of 27 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
mithril-stm/Cargo.toml Switch ciborium to workspace dependency for consistent versioning.
mithril-common/src/entities/type_alias.rs Add hex-encoded secret key type alias for protocol configuration markers.
mithril-common/src/crypto_helper/ed25519_alias.rs Add ED25519 type aliases for protocol configuration markers signing/verifying.
mithril-common/Cargo.toml Switch ciborium to workspace dependency.
mithril-aggregator/src/tools/protocol_configuration.rs New tool: verify imported configs against chain window + build signed datum + datum size check.
mithril-aggregator/src/tools/mod.rs Register/export ProtocolConfigurationTools.
mithril-aggregator/src/test/double/dummies.rs Add Dummy impl for HumanReadableProtocolConfiguration for tests.
mithril-aggregator/src/dependency_injection/containers/protocol_configuration.rs New DI container for protocol-configuration commands.
mithril-aggregator/src/dependency_injection/containers/mod.rs Export the new protocol-configuration DI container.
mithril-aggregator/src/dependency_injection/builder/support/compatibility.rs Add construction + getter for a ProtocolConfigurationMarkersReader (prod vs dummy).
mithril-aggregator/src/dependency_injection/builder/mod.rs Add stored dependency + container creation method for protocol-configuration commands.
mithril-aggregator/src/configuration.rs Add ProtocolConfigurationReaderParameters + ConfigurationSource accessor for reader params.
mithril-aggregator/src/commands/protocol_configuration_command.rs Implement CLI subcommands, JSON IO, consistency checks, datum generation.
mithril-aggregator/src/commands/mod.rs Wire new ProtocolConfiguration command into main CLI.
internal/mithril-protocol-config/src/test/double/mod.rs Export new dummy markers reader from test doubles.
internal/mithril-protocol-config/src/test/double/dummy_markers_reader.rs Add dummy ProtocolConfigurationMarkersReader for test environments.
internal/mithril-protocol-config/src/test/double/dummies.rs Add dummies for protocol-configuration marker models/messages.
internal/mithril-protocol-config/src/model.rs Add protocol configuration marker model + ConfigurationComputerFromMarkers helper with fallback lookup.
internal/mithril-protocol-config/src/lib.rs Export cardano_chain module publicly.
internal/mithril-protocol-config/src/interface.rs Add ProtocolConfigurationMarkersReader trait.
internal/mithril-protocol-config/src/cardano_chain/protocol_configuration_reader.rs Add Cardano-chain reader type for markers (currently stubbed).
internal/mithril-protocol-config/src/cardano_chain/payload.rs Add payload structs and signing helper for protocol configuration markers.
internal/mithril-protocol-config/src/cardano_chain/mod.rs Add Cardano-chain module exports for message/payload/reader.
internal/mithril-protocol-config/src/cardano_chain/message.rs Add CBOR message/codec for protocol configuration markers.
internal/mithril-protocol-config/Cargo.toml Add dependencies needed for CBOR/hex/serde + chain reader integration.
Cargo.toml Add workspace ciborium dependency.
Cargo.lock Lockfile updates for new deps/crate wiring.
Suppressed comments (1)

mithril-aggregator/src/commands/protocol_configuration_command.rs:345

  • User-facing CLI output contains spelling/grammar issues ("Sucessfuly write"), which makes the command output look unpolished.
        println!(
            "Sucessfuly write Tx datum file at {}",
            self.target_path.to_string_lossy()
        );

Comment thread mithril-aggregator/src/tools/protocol_configuration.rs Outdated
Comment thread mithril-aggregator/src/tools/protocol_configuration.rs
Comment thread mithril-aggregator/src/tools/protocol_configuration.rs
Comment thread mithril-aggregator/src/tools/protocol_configuration.rs Outdated
Comment thread mithril-aggregator/src/commands/protocol_configuration_command.rs Outdated
Comment thread mithril-aggregator/src/commands/protocol_configuration_command.rs
Comment thread mithril-aggregator/src/commands/protocol_configuration_command.rs Outdated
Comment thread internal/mithril-protocol-config/src/cardano_chain/message.rs Outdated
Comment thread internal/mithril-protocol-config/src/model.rs
@turmelclem
turmelclem force-pushed the ctl/3392-add-aggregator-CLI-command-for-configuration-parameters branch 4 times, most recently from aba2fbb to 0f67a96 Compare July 31, 2026 15:54
@turmelclem
turmelclem temporarily deployed to testing-preview July 31, 2026 16:09 — with GitHub Actions Inactive
@turmelclem
turmelclem force-pushed the ctl/3392-add-aggregator-CLI-command-for-configuration-parameters branch from c990269 to 50e2689 Compare August 5, 2026 13:55
@turmelclem
turmelclem requested review from Alenar and jpraynaud August 5, 2026 13:55
Comment thread mithril-aggregator/src/commands/protocol_configuration_command.rs Fixed
@turmelclem
turmelclem force-pushed the ctl/3392-add-aggregator-CLI-command-for-configuration-parameters branch from 50e2689 to c7a16da Compare August 5, 2026 14:02
Comment thread mithril-aggregator/src/commands/protocol_configuration_command.rs Fixed
Comment thread mithril-aggregator/src/commands/protocol_configuration_command.rs Fixed
Comment thread mithril-aggregator/src/commands/protocol_configuration_command.rs Fixed
Comment thread mithril-aggregator/src/commands/protocol_configuration_command.rs Fixed
@turmelclem
turmelclem force-pushed the ctl/3392-add-aggregator-CLI-command-for-configuration-parameters branch from c7a16da to 5792cc0 Compare August 5, 2026 14:24
Comment thread mithril-aggregator/src/commands/protocol_configuration_command.rs
@turmelclem
turmelclem force-pushed the ctl/3392-add-aggregator-CLI-command-for-configuration-parameters branch from 5792cc0 to 97b316f Compare August 5, 2026 14:46
@turmelclem
turmelclem force-pushed the ctl/3392-add-aggregator-CLI-command-for-configuration-parameters branch from 97b316f to a134e72 Compare August 5, 2026 14:51
@turmelclem
turmelclem temporarily deployed to testing-2-preview August 5, 2026 15:11 — with GitHub Actions Inactive
@turmelclem
turmelclem requested a review from jpraynaud August 5, 2026 15:28

@jpraynaud jpraynaud left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@Alenar Alenar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you forgot to rename the file following the renaming of the structure 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement aggregator CLI commands for configuration parameters

5 participants